#include "global.h"
SDL_Window *win;
SDL_Renderer *ren;
int main(int argc, char **argv)
{
    SDL_Init(SDL_INIT_VIDEO);
    TTF_Init();
    win = SDL_CreateWindow("SDL2", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_RendererFlags::SDL_RENDERER_ACCELERATED);
    ren = SDL_CreateRenderer(win, -1, SDL_RendererFlags::SDL_RENDERER_ACCELERATED);
    //设置渲染器颜色
    SDL_Color color = {255, 0, 0};
    //SDL_SetRenderDrawColor(ren, 255, 0, 0, 255);
    //SDL_RenderFillRect(ren, &rect);
    //画一些东西
    /*SDL_RenderDrawLine(ren,0,0,100,200);
    SDL_SetRenderDrawColor(ren,0,255,0,1);
    SDL_RenderDrawLine(ren,0,0,400,400);*/
    SDL_Point point1={0,0};
    SDL_Point point2={100,100};
    //draw_line(&point1,&point2);
    //文字
    SDL_Color red= {255,0,0,255};
    SDL_RenderClear(ren);
    draw_text("120",point2,red,32);
    //提交绘制
    SDL_RenderPresent(ren);
    SDL_Event event;
    while(true)
    {
        while (SDL_PollEvent( &event ))
        {
            //printf("event");
            if(event.type==SDL_QUIT)
            {
                exit(0);
            }
            SDL_Delay(16);
        }
        
     
    }
    return 0;
}